<?php
registerTable("home_activity", new table_home_activity());

class table_home_activity extends Database
{

    public function __construct()
    {
        parent::__construct("home_activity");
    }

    public function fetch_by_aid($aid)
    {
        return $this->fetch_assoc("`aid`='$aid'");
    }

    public function fetch_by_uid_public($uid, $offset, $amount)
    {
        return $this->fetch_all_assoc("`uid` = $uid AND `view_level` = 0", "*", "ORDER BY `date` DESC LIMIT $offset,$amount");
    }

    public function fetch_by_uid($uid, $offset, $amount)
    {
        return $this->fetch_all_assoc("`uid` = $uid", "*", "ORDER BY `date` DESC LIMIT $offset,$amount");
    }
}
?>